package com.coolcode.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @RequestMapping("/hello")
    @PreAuthorize("hasAuthority('system:dept:list')")
    public String hello() {
        return "hello";
    }

    @RequestMapping("/test")
    @PreAuthorize("ex.hasAuthority('system:test:list')") // 自定义权限校验
    public String test() {
        return "test";
    }
}
